package com.javatoc.imgcompress;

public class InvokeImgCompress {

	static {
		try {
			System.out.println("load lib info:" + System.getProperty("java.library.path"));
			System.loadLibrary("jpegCompressTozcc");
			System.out.println("load lib info over!");
		} catch (UnsatisfiedLinkError e) {
			System.out.println("Cannot load jpegCompressTozcc library:\n " + e.toString());
		}
	}

	public static void main(String[] args) {

		ImgCompress imgComp = new ImgCompress();

		imgComp.dllInit();

		long startTime = System.currentTimeMillis();
		for (int i = 0; i < 100; i++) {
			String src = "/home/imgcompress/jpeg2zcc-linux-x64-20171129/linux/src/001.jpg";
			String out = "/home/imgcompress/jpeg2zcc-linux-x64-20171129/linux/out/002.zcc";
			imgComp.dllZccZip(src, out);
		}
		long endTime = System.currentTimeMillis();
		System.out.println("use time :" + (endTime - startTime) / 1000.0f);

		System.out.println("CompressMoveMain compress over");
	}

}
